import React from 'react';
import './App.css';
// import {HashRouter,Route,Redirect} from 'react-router-dom'
// import {About, Contact, Events, Home, Products} from "./pages/home";
// import Login from "./pages/login";
// import IndexPage from "./pages/IndexPage";
// import {Company, History, Location, Services} from "./com/AboutMain/AboutMain";
import {HashRouter} from 'react-router-dom'
import routerList from './router/index'
import PrivateRoute from './com/PrivateRoute'
class App extends React.Component{
    render(){
        return(
            <div className="App">
                <HashRouter>
                    {/*app组件将路由数据下发*/}
                    <PrivateRoute routers={routerList}/>
                    {/*没有自己封装路由组件的情况下*/}
                    {/*<Route path="/Login" component={Login}/>*/}
                    {/*<Route path="/Main" render={()=>*/}
                    {/*    <IndexPage>*/}
                    {/*        <Route path="/Main/Home" component={Home}/>*/}
                    {/*        <Route path="/Main/About" render={()=>*/}
                    {/*            <About>*/}
                    {/*                <Route path="/Main/About/Company" component={Company}/>*/}
                    {/*                <Route path="/Main/About/Location" component={Location}/>*/}
                    {/*                <Route path="/Main/About/History" component={History}/>*/}
                    {/*                <Route path="/Main/About/Services" component={Services}/>*/}
                    {/*                <Redirect to="/Main/About/Company"/>*/}
                    {/*            </About>*/}
                    {/*        }/>*/}
                    {/*        <Route path="/Main/Events" component={Events}/>*/}
                    {/*        <Route path="/Main/Products" component={Products}/>*/}
                    {/*        <Route path="/Main/Contact" component={Contact}/>*/}
                    {/*        <Redirect to="/Main/Home"/>*/}
                    {/*    </IndexPage>*/}
                    {/*}/>*/}
                    {/*<Redirect exact  path='/' to='/Login'/>*/}
                </HashRouter>
            </div>
        )
    }

}



export default App;
